﻿using System;
using System.ComponentModel;
using System.Runtime.CompilerServices;


namespace FixtureManageSystem.Models
{
    /// <summary>
    /// 夹具模型
    /// 由物料名称、物料编码、物料型号、适用项目、条码、数量、库位、材质、责任人、价格
    /// </summary>
    public class Fixture :BaseModel,INotifyPropertyChanged
    {
        public event PropertyChangedEventHandler PropertyChanged;
        /// 条形码
        private string barCode = String.Empty;
        public string BarCode
        {
            get
            {
                return barCode;
            }
            set
            {
                if (value != this.barCode)
                {
                    barCode = value;
                }
            }
        }

        /// <summary>
        /// 名称
        /// </summary>
        private string name = String.Empty;
        public string Name
        {
            get
            {
                return name;
            }
            set
            {
                if (value != this.name)
                {
                    name = value;
                }
            }
        }

        /// <summary>
        /// 物料型号
        /// </summary>
        /// <param name="factory"></param>

        private string materialType = String.Empty;
        public string MaterialType
        {
            get
            {
                return materialType;
            }
            set
            {
                if (value != this.materialType)
                {
                    materialType = value;
                }
            }
        }


        //物料数量
        private int num;
        public int Num
        {
            get { return num; }
            set
            {
                if (value != this.num)
                {
                    num = value;
                }
            }
        }

        // 存放库位
        private string position;
        public string Position
        {
            get { return position; }
            set
            {
                if (value != this.position)
                {
                    position = value;
                }
            }
        }

        private void OnPropertyChanged([CallerMemberName] String propertyName = "")
        {
            PropertyChanged.Invoke(this, new PropertyChangedEventArgs(propertyName));
        }
    }
}
